package com.zb.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.zb.excel.converter.CodeStoreStatusIntegerToStringConverter;
import com.zb.entity.ZjCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/9/9 0009
 **/
@Data
@Accessors(chain = true)
@ApiModel("编码批次Excel对象")
@HeadRowHeight(30)  // 表头行高
@ContentRowHeight(15)  //内容行高
@ColumnWidth(18)  //列宽
public class CodeBatchExcel {
    @ExcelProperty("批号名称")
    private String batchName;

    @ExcelProperty(value = "批号")
    private String batchCode;

    @ExcelProperty(value = "防伪编码")
    private String code;

    @ExcelProperty(value = "编码状态", converter = CodeStoreStatusIntegerToStringConverter.class)
    private Integer codeStatus;

    @ExcelProperty(value = "仓库编码")
    private String storeCode;

    @ExcelProperty(value = "编码出入库状态", converter = CodeStoreStatusIntegerToStringConverter.class)
    @ColumnWidth(value = 20)
    private Integer storeStatus;

    @ApiModelProperty(value = "编码类型：1-成品，2-配件")
    @ExcelProperty(value = "商品类型", converter = CodeStoreStatusIntegerToStringConverter.class)
    private Integer type;

    @ExcelProperty(value = "商品品牌")
    private String brand;

    @ExcelProperty(value = "商品型号")
    private String model;

    @ApiModelProperty(value = "商品分类")
    @ExcelProperty(value = "商品分类")
    private String goodsType;

    @ExcelProperty(value = "商品规格名称")
    private String specName;

    @ExcelProperty(value = "登记时间")
    private Date regsiterTime;

    public CodeBatchExcel(){}

    public CodeBatchExcel(ZjCode code){
        this.code = code.getSecurityCode();
        this.codeStatus = code.getStatus();
        this.storeCode = code.getStoreCode();
        this.storeStatus = code.getStoreStatus();
    }





}
